﻿@{
    ViewBag.Title = "AddWMItemRepcot";
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Demo</title>
    <!-- 引入 layui.css -->
    <link href="~/layui/css/layui.css" rel="stylesheet" />
    <script src="~/layui/layui.js"></script>
    <script src="~/libs/jquery/jquery.js"></script>
</head>
<body>
    <form class="layui-form" action="" onsubmit="return false">
        <div class="layui-form-item">
            <label class="layui-form-label">入库单编码</label>
            <div class="layui-input-block">
                <input type="text" name="RecptCode" id="RecptCode" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
                <input type="checkbox" name="AAA" lay-skin="switch">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">入库单名称</label>
            <div class="layui-input-block">
                <input type="text" id="RecptName" name="RecptName" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">入库日期</label>
            <div class="layui-input-block">
                <input type="text" class="layui-input" id="RecptDate" placeholder="yyyy-MM-dd HH:mm:ss">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">采购订单号</label>
            <div class="layui-input-block">
                <input type="text" id="PoCode" name="PoCode" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">订单状态</label>
            <div class="layui-input-inline layui-input-wrap">
                <select name="Status" id="Status" lay-verify="required" lay-search disabled>
                    <option value="草稿">草稿</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">供应商</label>
            <div class="layui-input-inline layui-input-wrap">
                <select name="VendorName" id="VendorName" lay-verify="required" lay-search>
                    <option value="">请选择供应商</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">入库仓库</label>
            <div class="layui-input-inline layui-input-wrap">
                <select name="WarehouseName" id="WarehouseName" lay-verify="required" lay-search>
                    <option value="">请选择仓库</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item layui-form-text">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-block">
                <textarea placeholder="请输入内容" class="layui-textarea" name="remark"></textarea>
            </div>
        </div>

    </form>
    <!-- 引入 layui.js -->
    <script src="~/libs/jquery/jquery.js"></script>
    <script src="~/layui/layui.js"></script>
    <script type="text/javascript">
        layui.use(['form', 'dropdown', 'laydate', 'jquery'], function () {
            var $ = layui.$;
            var form = layui.form;
            var laydate = layui.laydate;

            laydate.render({
                elem: '#RecptDate',
                type: 'datetime'
            });
            // //动态绑定仓库
            $(document).ready(function () {
                $.ajax({
                    url: '/WMItemRepoct/GetWmWarehouse',
                    type:'GET',
                    dataType:'json',
                    success: function (data) {
                        var options = '';
                        $.each(data.data, function (index, item) {
                            options += '<option value="' + item.WarehouseName + '">' + item.WarehouseName + '</option>'
                        });
                        $('#WarehouseName').append(options);
                        form.render('select');
                    }
                })
            })

            // //动态绑定仓库
            $(document).ready(function () {
                $.ajax({
                    url: '/WMItemRepoct/GetVendor',
                    type: 'GET',
                    dataType: 'json',
                    success: function (data) {
                        var options = '';
                        $.each(data.data, function (index, item) {
                            options += '<option value="' + item.VendorName + '">' + item.VendorName + '</option>'
                        });
                        $('#VendorName').append(options);
                        form.render('select');
                    }
                })
            })

            //随机数
            function `  
            
            
            
               n  () {
                var num = Math.floor(1000 + Math.random() * 9000); // 生成1000到9999之间的随机数
                var number = "WF" + num
                return number;
            }
           
        })
    </script>
</body>
</html>
